﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _20VariationsRepeated
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = 3;
            int k = 2;
            int[] array = new int[k];
            for (int i = 0; i < array.Length; i++)
            {
                array[i] = 1;
            }
            for (int i = array.Length - 1; i >= 0; i--)
            {
                for (int j = 1; j <= n; j++)
                {
                    array[i] = j;
                    foreach (var item in array)
                    {
                        Console.Write(item + " ");
                    }
                    Console.WriteLine();
                }
                array[i] = 1;
            }
        }
    }
}
